home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
59
/
59.xpi
/
chrome
/
useragentswitcher.jar
/
content
/
useragentswitcher
/
common
/
array.js
next >
Wrap
Text File
|
2009-06-30
|
624b
|
33 lines
// User Agent Switcher array
var UserAgentSwitcherArray =
{
// Converts a collection to an array
convertCollectionToArray: function(collection)
{
var array = [];
var collectionLength = collection.length;
// Loop through the collection
for(var i = 0; i < collectionLength; i++)
{
array.push(collection.item(i));
}
return array;
},
// Converts an enumeration to an array
convertEnumerationToArray: function(enumeration)
{
var array = [];
// Loop through the enumeration
while(enumeration.hasMoreElements())
{
array.push(enumeration.getNext());
}
return array;
}
};